package tue.cse.advanceddatabases.project.xml.genre;

import java.util.List;
import java.util.Vector;
import java.util.logging.Logger;

import org.dom4j.Element;

public class GenreParser {
	private static Logger logger = Logger.getLogger(GenreParser.class.getName());
	
	public static List<Genre> parse(List<Element> genresElement) {
		return parse(genresElement.get(0));
	}
	
	public static List<Genre> parse(Element genresElement) {
		List<Genre> genres = new Vector<Genre>();
		
		List<Element> genreElements = genresElement.elements();
		
		logger.info("Number of Genres are:" + genreElements.size());
		for (int i=0; i< genreElements.size();i++){
			Element element = genreElements.get(i);
			genres.add(new Genre(element));
		}
		return genres;
	}

}